from  django.urls import path,re_path


from . import views
from rest_framework.routers import DefaultRouter
from rest_framework.urlpatterns import format_suffix_patterns
router = DefaultRouter()
router.register('salts',viewset=views.SaltMasterViewSet)
router.register('hosts',viewset=views.HostViewSet)
router.register('hostauths',viewset=views.SaltAuthViewSet)



urlpatterns = [
    # 根据不同的类型获取saltapi认证主机类型
    path('minions/<str:s_type>/', views.SaltMinionsView.as_view(), name='getsalt'),
    path('authminions/<str:s_type>/<int:pk>/', views.AuthSaltMinions.as_view(), name='authsalt'),
    #测试异步任务
    path('send_email/',views.test_send_email,name='send_email'),

]
urlpatterns = format_suffix_patterns(urlpatterns)
urlpatterns += router.urls